package cc.wsyw126.java.stream;

import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * Created by junpeng.yang on 16/8/24.
 */
public class JavaTestLimitSkipSorted {
    public static void main(String[] args) {
        Stream.of(new String[]{"thisis", "metest", "qw","qwe","qwer","asdfg"}).limit(3).skip(1).sorted((o1,o2) -> o1.length()>o2.length()?1:-1).forEach(System.out::println);
        System.out.println("--------------");
        Stream.of(new String[]{"thisisme", "metests", "qw", "qwe", "qwer", "asdfg"}).sorted((o1,o2) -> o1.length()>o2.length()?1:-1).limit(3).skip(1).forEach(System.out::println);
    }
}
